﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderAdd.aspx.cs" Inherits="WebSite.admin.order.OrderAdd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head id="Head1" runat="server">
     <title></title>
     <link href="../css/skin.css" rel="stylesheet" type="text/css" />
     <script language="javascript" type="text/javascript">

         function openModelWindow() {

             var ids = document.getElementById("extForm1_Panel1_hdCardTypes").value;
             var cardcode = document.getElementById("extForm1_Panel1_hdCardCode").value;
             var code = document.getElementById("extForm1_lblOrderCode").innerText;
             if (cardcode != "") {
                 X('Window1').box_show('/admin/order/selectGoodsList.aspx?typeids=' + ids + '&code=' + code + '&cardcode=' + cardcode, '选择商品');
             } else {
             alert("请先添加卡券！");
             }
         }
     </script>
</head>
                                                
<body  bgcolor="#F1F4F7">
    <form id="form1" runat="server">
      <ext:PageManager ID="PageManager1" runat="server" />
      <ext:SimpleForm ID="extForm1" runat="server" BodyPadding="5px"   
            EnableBackgroundColor="false" Title="输入卡片"  ShowHeader="true" >
              <Items>
              <ext:Label ID="lblOrderCode" runat="server" Label="订单号" ></ext:Label>
            <ext:Panel ID="Panel2" ShowHeader="false"  CssClass="x-form-item" ShowBorder="false" Layout="Column" runat="server">

             <Items>
             <ext:Label ID="lblRowCount"  Width="40px"  runat="server" Text="&nbsp;卡号："></ext:Label>
                <ext:TextBox runat="server" ID="txtCardCode" Label="卡号" MaxLength="20" ShowRedStar="true" Required="true" ></ext:TextBox>
                <ext:Label ID="Label1"  Width="40px"  runat="server" Text="&nbsp;密码："></ext:Label>
                  <ext:TextBox runat="server" ID="txtCardPass" Label="密码" MaxLength="20" TextMode="Password" ShowRedStar="true" Required="true"></ext:TextBox>
                   <ext:Button ID="btnCardAdd" runat="server" Text="添加"   ValidateForms="extForm1" 
                     OnClick="btnCardAdd_Click" ></ext:Button>
                  </Items>
         </ext:Panel>
               <ext:Panel ID="Panel1" ShowHeader="false"  CssClass="x-form-item" ShowBorder="false" Layout="Column" runat="server">
               <Items>
                 <ext:Label ID="lblCardInfo" EncodeText="false" runat="server"  ></ext:Label>
                 <ext:HiddenField ID="hdCardTypes" runat="server"></ext:HiddenField>
                 <ext:HiddenField ID="hdCardCode" runat="server"></ext:HiddenField>
                 </Items>
            </ext:Panel>
           <ext:Button ID="btnSelectGoods" runat="server" OnClientClick="openModelWindow();"   EnablePostBack="false" Text="选择商品">  </ext:Button> 
     </Items>
     
   </ext:SimpleForm>
      <ext:Grid ID="Grid1" Title="查询结果" PageSize="50" ShowBorder="false"  
          CssClass="x-form-item"  Height="150px"  AllowPaging="false" 
          SortColumn="goodsName" SortDirection="ASC"     
                        ShowHeader="true" runat="server" 
          EnableCheckBoxSelect="false"   AllowSorting="true"    IsDatabasePaging="false" 
                        DataKeyNames="goodsId" OnSort="Grid1_Sort" 
          EnableRowNumber="True" onrowcommand="Grid1_RowCommand">
        <Columns>
             <ext:BoundField Width="160" ColumnID="goodsCode" SortField="goodsCode" DataField="goodsCode" DataFormatString="{0}"
                HeaderText="商品编号" />
           <ext:BoundField Width="260px" ColumnID="goodsName" SortField="goodsName" DataField="goodsName" DataFormatString="{0}"
                HeaderText="商品名称" />
        <ext:BoundField Width="200px" ColumnID="modelTypeName" SortField="modelTypeName" DataField="modelTypeName" DataFormatString="{0}"
                HeaderText="商品型号" />
           <ext:BoundField Width="100px" ColumnID="goodsPoints" SortField="goodsPoints" DataField="goodsPoints" DataFormatString="{0}"
                HeaderText="福点数" />
             <ext:BoundField Width="100px" ColumnID="goodsCount" SortField="goodsCount" DataField="goodsCount" DataFormatString="{0}"
                HeaderText="数量" />
          <ext:BoundField Width="100px" ColumnID="sumGoodsPoints" SortField="sumGoodsPoints" DataField="sumGoodsPoints" DataFormatString="{0}"
                HeaderText="总福点数" />
        <ext:WindowField Width="60px" WindowID="Window2" HeaderText="" Text="修改数量"   ToolTip="修改数量" DataIFrameUrlFields="goodsId,orderCode,goodsPoints,modelTypeId"
                    DataIFrameUrlFormatString="orderGoodsCountEdit.aspx?id={0}&code={1}&points={2}&mid={3}" Title="修改数量"
                    IFrameUrl="~/alert.aspx" />
       <ext:LinkButtonField ConfirmText="你确定要删除吗？" ConfirmTarget="Top" ColumnID="lbfDeleted"
                Width="50px" CommandName="deleted" Text="删除" />



        </Columns>
    </ext:Grid>
     <ext:Panel ID="Panel3" Title="订单信息" CssClass="x-form-item"  ShowBorder="false" ShowHeader="false" Layout="Column" runat="server">
            <Toolbars>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                           <ext:Label ID="lblOrderInfo" runat="server" Text="订单信息"></ext:Label>
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
             <Items>
          </Items>
        </ext:Panel>
           <ext:form ID="Form2" runat="server" BodyPadding="5px" 
            EnableBackgroundColor="true" Title="" ShowHeader="false" >
            <Rows>
                 <ext:FormRow  ColumnWidths="25% 25% 25% 25%">
                 <Items>
                  <ext:TextBox ID="txtUserName" ShowRedStar="true" Required="true" runat="server" Label="收件人"></ext:TextBox>
                     <ext:TextBox ID="txtTel" ShowRedStar="true" Required="true" runat="server" Label="联系电话1"></ext:TextBox>
                <ext:TextBox ID="txtMobile" runat="server" Label="联系电话2"></ext:TextBox>
                   <ext:Label ID="Label3"   runat="server" Text="&nbsp;"></ext:Label>
                 </Items>
                 </ext:FormRow>
                 <ext:FormRow ColumnWidths="25% 25% 25% 25%">
                <Items>
                       <ext:dropdownlist ID="ddlSheng" Label="送货地址&nbsp;省份" ShowRedStar="true" CompareType="String"
                            CompareValue="-1" CompareOperator="NotEqual" CompareMessage="请选择省份！" runat="server"
                            AutoPostBack="true" OnSelectedIndexChanged="ddlSheng_SelectedIndexChanged" >
                        </ext:dropdownlist>
                        <ext:dropdownlist ID="ddlShi" Label="地区市" ShowRedStar="true" CompareType="String"
                            CompareValue="-1" CompareOperator="NotEqual" CompareMessage="请选择地区市！" runat="server"
                            AutoPostBack="true" OnSelectedIndexChanged="ddlShi_SelectedIndexChanged">
                        </ext:dropdownlist>
                        <ext:dropdownlist ID="ddlXian" ShowRedStar="false" CompareType="String" CompareValue="-1"
                            CompareOperator="NotEqual" CompareMessage="请选择县区市！" Label="县区市" runat="server">
                        </ext:dropdownlist>
                        <ext:textbox ID="txtPostcode"  Label="邮  编" runat="server" Text=""></ext:textbox>
                </Items>
            </ext:FormRow>
               <ext:FormRow>
                  <Items> 
               <ext:TextBox ID="txtAddress" runat="server" Required="true" ShowRedStar="true" Label="送货地址"></ext:TextBox>
                  </Items>
             </ext:FormRow>
             <ext:FormRow ColumnWidths="50% 50%">
               <Items>
             
               </Items>
             </ext:FormRow>
                <ext:FormRow ColumnWidths="50% 50%">
               <Items>
                   <ext:DatePicker ID="dpkSendTime" Width="100px" Label="送货日期" runat="server">
                    </ext:DatePicker>
                
               </Items>
             </ext:FormRow>
               <ext:FormRow>
               <Items>
                    <ext:Label ID="lblTimeTo"    runat="server" Text="*到货日期为发货日期延后二天，但由于快递送达时间不受人为因素所控制，实际到货前后会有一天的误差。"></ext:Label>
               </Items>
             </ext:FormRow>
                <ext:FormRow>
               <Items>
                      <ext:TextBox ID="txtRemark" runat="server" Label="备注" ></ext:TextBox>  
               </Items>
             </ext:FormRow>

                 <ext:FormRow>
                  <Items>
                <ext:Button ID="btnSubmitOrder" Text="确认下单"  CssClass="mleft mright" 
                          ValidateTarget="Parent" runat="server" ValidateForms="Form2" 
                          ConfirmText="确认要提交吗？" OnClick="btnSubmitOrder_Click"    ></ext:Button>
                     </Items>
             </ext:FormRow>
                </Rows>
                </ext:form>

                     <ext:Window ID="Window1" Title="选择商品" Popup="false" EnableIFrame="true" IFrameUrl="about:blank"
        Target="Parent" runat="server"   CloseAction="HidePostBack" IsModal="true" Width="800px"
        EnableConfirmOnClose="true"  OnClose="Window1_Close" Height="500px">
    </ext:Window>

          <ext:Window ID="Window2" Title="修改商品数量" Popup="false" EnableIFrame="true" IFrameUrl="about:blank"
        Target="Parent" runat="server"   CloseAction="HidePostBack" IsModal="true" Width="240px"
        EnableConfirmOnClose="true"  OnClose="Window2_Close" Height="100px">
    </ext:Window>


    </form>
</body>
</html>
